]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dnd: Remove buttonDown private property
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 17 Mar 2022 20:27:28 +0000 (21:27 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 24 Feb 2023 15:32:06 +0000 (15:32 +0000)
This was introduced with commit
6cae94edcc23cbbb509c3a02833b132c6e0aa74f, it doesn't seem to make sense
anymore these days.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2318>

js/ui/dnd.js

index 63ce5a0201362eaaf69d86e5b259b65e9cb69fcd..4ba724d1f624cf0e493c37b615e2dcdbe53f71a4 100644 (file)
@@ -115,7 +115,6 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
         this._dragActorOpacity = params.dragActorOpacity;
         this._dragTimeoutThreshold = params.timeoutThreshold;
 
-        this._buttonDown = false; // The mouse button has been pressed and has not yet been released.
         this._animationInProgress = false; // The drag is over and the item is in the process of animating to its original position (snapping back or reverting).
         this._dragCancellable = true;
     }
@@ -124,7 +123,6 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
         if (event.get_button() != 1)
             return Clutter.EVENT_PROPAGATE;
 
-        this._buttonDown = true;
         this._grabActor(event.get_device());
 
         let [stageX, stageY] = event.get_coords();
@@ -151,7 +149,6 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
             !global.display.is_pointer_emulating_sequence(event.get_event_sequence()))
             return Clutter.EVENT_PROPAGATE;
 
-        this._buttonDown = true;
         this._grabActor(event.get_device(), event.get_event_sequence());
         this._dragStartTime = event.get_time();
         this._dragThresholdIgnored = false;
@@ -243,7 +240,6 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
         // to complete the drag and ensure that whatever happens to be under the pointer does
         // not get triggered if the drag was cancelled with Esc.
         if (this._eventIsRelease(event)) {
-            this._buttonDown = false;
             if (this._dragState == DragState.DRAGGING) {
                 return this._dragActorDropped(event);
             } else if ((this._dragActor != null || this._dragState == DragState.CANCELLED) &&
@@ -288,7 +284,6 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
      * PopupMenu.ignoreRelease())
      */
     fakeRelease() {
-        this._buttonDown = false;
         this._ungrabActor();
     }
 
@@ -703,8 +698,7 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
 
         if (this._actorDestroyed || wasCancelled) {
             global.display.set_cursor(Meta.Cursor.DEFAULT);
-            if (!this._buttonDown)
-                this._dragComplete();
+            this._dragComplete();
             this.emit('drag-end', eventTime, false);
             if (!this._dragOrigParent && this._dragActor)
                 this._dragActor.destroy();
@@ -755,8 +749,7 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
             return;
 
         this._animationInProgress = false;
-        if (!this._buttonDown)
-            this._dragComplete();
+        this._dragComplete();
 
         global.display.set_cursor(Meta.Cursor.DEFAULT);
     }